package com.network.demo.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class ErrorInfo {

    private int code;
    private String message;
    private Object deta;
    
    public ErrorInfo(int code, String message) {
        this.code = code;
        this.message = message;
        this.deta = "";
    }

    public static ErrorInfo success(String message) {
        return new ErrorInfo(200, message);
    }

    public static ErrorInfo success(String message, Object deta) {
        return new ErrorInfo(200, message, deta);
    }

    public static ErrorInfo error(int code, String message) {
        return new ErrorInfo(code, message);
    }
}